<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MNNKit: MNNFaceDetection/iOS/MNNFaceDetection/MNNFaceDetection/MNNFaceDetector.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="mnn.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MNNKit
   &#160;<span id="projectnumber">1.0</span>
   </div>
   <div id="projectbrief">MNNKit is a collection of AI solutions on mobile phone, powered by MNN engine.</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',false,false,'search.php','Search');
});
/* @license-end */</script>
<div id="main-nav"></div>
<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="dir_ff51bd0b7841751e6292791fdaa2b577.html">MNNFaceDetection</a></li><li class="navelem"><a class="el" href="dir_afc4351b0ff58faa23b45bf1feab612f.html">iOS</a></li><li class="navelem"><a class="el" href="dir_3aa9bd88010d07c3276bd22be45efe2a.html">MNNFaceDetection</a></li><li class="navelem"><a class="el" href="dir_2c0e3c1d608b08fe3fb3b92cc06213c1.html">MNNFaceDetection</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">MNNFaceDetector.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="_m_n_n_face_detector_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment">//  MNNFaceDetector.h</span></div>
<div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment">//  MNNFaceDetection</span></div>
<div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment">//  Created by MNN on 2019/12/2.</span></div>
<div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment">//  Copyright © 2019, Alibaba Group Holding Limited</span></div>
<div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment">//</span></div>
<div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160; </div>
<div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="preprocessor">#import &lt;Foundation/Foundation.h&gt;</span></div>
<div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="preprocessor">#import &lt;UIKit/UIKit.h&gt;</span></div>
<div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="preprocessor">#import &lt;MNNKitCore/CommonDef.h&gt;</span></div>
<div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno"><a class="line" href="_m_n_n_face_detector_8h.html#a57567af2cbd9dd6cc412f27cba05e8fc">   13</a></span>&#160;<span class="keyword">static</span> NSString *<a class="code" href="_m_n_n_face_detector_8h.html#a57567af2cbd9dd6cc412f27cba05e8fc">MNNKitErrorDomain</a> = <span class="stringliteral">@&quot;MNNKitErrorDomain&quot;</span>;</div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160; </div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00017"></a><span class="lineno"><a class="line" href="_m_n_n_face_detector_8h.html#a9835273e36af0cb70abe85ff24fe54f6">   17</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="_m_n_n_face_detector_8h.html#a9835273e36af0cb70abe85ff24fe54f6">NS_ENUM</a>(NSUInteger, MNNFaceDetectConfig) {</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment">//    FACE_DETECT       = 1,        /// face 106 points detect</span></div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;    EYE_BLINK         = 1&lt;&lt;1,     </div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;    MOUTH_AH          = 1&lt;&lt;2,     </div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;    HEAD_YAW          = 1&lt;&lt;3,     </div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;    HEAD_PITCH        = 1&lt;&lt;4,     </div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;    BROW_JUMP         = 1&lt;&lt;5,     </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;};</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160; </div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="_m_n_n_face_detector_8h.html#acabc0c738da79634139649fdfe29ad1a">   28</a></span>&#160;<span class="keyword">typedef</span> <a class="code" href="_m_n_n_face_detector_8h.html#a9835273e36af0cb70abe85ff24fe54f6">NS_ENUM</a>(NSUInteger, MNNFaceDetectMode) {</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;    MNN_FACE_DETECT_MODE_VIDEO = 0x10000000,</div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;    MNN_FACE_DETECT_MODE_IMAGE = 0x20000000,<span class="comment">// image detect</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;};</div>
<div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detector_create_config.html">   33</a></span>&#160;<span class="keyword">@interface </span><a class="code" href="interface_m_n_n_face_detector_create_config.html">MNNFaceDetectorCreateConfig</a> : NSObject</div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160; </div>
<div class="line"><a name="l00036"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detector_create_config.html#af9b39fe67ad33dfe3dcc0dedebb3eab3">   36</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) MNNFaceDetectMode <a class="code" href="interface_m_n_n_face_detector_create_config.html#af9b39fe67ad33dfe3dcc0dedebb3eab3">detectMode</a>;</div>
<div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160; </div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="keyword">@end</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160; </div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html">   42</a></span>&#160;<span class="keyword">@interface </span><a class="code" href="interface_m_n_n_face_detection_report.html">MNNFaceDetectionReport</a> : NSObject</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160; </div>
<div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#a921dcc601d9c04acac1ef324bbfa19da">   45</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) CGRect rect;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160; </div>
<div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#a4300fb0dcf830319eb70ab6075bedaea">   48</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) NSInteger faceId;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#ae353c9e54183dc673575c6613c5594f6">   51</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) CGPoint *keyPoints;</div>
<div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#a4b0409952be23206827fcf8d800dbdf0">   53</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) CGFloat *visibilities;</div>
<div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#a32eada6fc8df761231cfb518869bb867">   55</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) CGFloat score;</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160; </div>
<div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#ad1a381c18d5bae32ec97744e48aa61e0">   58</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) CGFloat yaw;</div>
<div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#a43b4b3ca4305fdb009394d2e8d9cdede">   60</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) CGFloat pitch;</div>
<div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#ad43eb6f52b4a345cd82acff6286aee64">   62</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) CGFloat roll;</div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160; </div>
<div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detection_report.html#a02284790f79b88c53b4471d208a7dd6d">   64</a></span>&#160;<span class="keyword">@property</span> (nonatomic, assign) <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> faceAction;</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;<span class="keyword">@end</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160; </div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160; </div>
<div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="interface_m_n_n_face_detector.html">   70</a></span>&#160;<span class="keyword">@interface </span><a class="code" href="interface_m_n_n_face_detector.html">MNNFaceDetector</a> : NSObject</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160; </div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;+ (void)createInstanceAsync:(<a class="code" href="interface_m_n_n_face_detector_create_config.html">MNNFaceDetectorCreateConfig</a>*)config callback:(<span class="keywordtype">void</span>(^)(NSError *error, <a class="code" href="interface_m_n_n_face_detector.html">MNNFaceDetector</a> *faceDetector))block;</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;+ (void)createInstanceAsync:(<a class="code" href="interface_m_n_n_face_detector_create_config.html">MNNFaceDetectorCreateConfig</a>*)config callback:(<span class="keywordtype">void</span>(^)(NSError *error, <a class="code" href="interface_m_n_n_face_detector.html">MNNFaceDetector</a> *faceDetector))block callbackQueue:(dispatch_queue_t)callbackQueue;</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160; </div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;- (NSArray&lt;<a class="code" href="interface_m_n_n_face_detection_report.html">MNNFaceDetectionReport</a> *&gt; *)inference:(CVPixelBufferRef)pixelBuffer config:(MNNFaceDetectConfig)detectConfig</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;                                           angle:(<span class="keywordtype">float</span>)inAngle outAngle:(<span class="keywordtype">float</span>)outAngle flipType:(MNNFlipType)flipType</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;                                           error:(NSError *__autoreleasing *)error;</div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160; </div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;- (NSArray&lt;<a class="code" href="interface_m_n_n_face_detection_report.html">MNNFaceDetectionReport</a> *&gt; *)inferenceImage:(UIImage*)image config:(MNNFaceDetectConfig)detectConfig</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;                                                angle:(<span class="keywordtype">float</span>)inAngle outAngle:(<span class="keywordtype">float</span>)outAngle flipType:(MNNFlipType)flipType</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;                                                error:(NSError *__autoreleasing *)error;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;- (NSArray&lt;<a class="code" href="interface_m_n_n_face_detection_report.html">MNNFaceDetectionReport</a> *&gt; *)inference:(<span class="keywordtype">unsigned</span> <span class="keywordtype">char</span>*)data width:(<span class="keywordtype">float</span>)w height:(<span class="keywordtype">float</span>)h format:(MNNCVImageFormat)format</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;                                          config:(MNNFaceDetectConfig)detectConfig</div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;                                           angle:(<span class="keywordtype">float</span>)inAngle outAngle:(<span class="keywordtype">float</span>)outAngle flipType:(MNNFlipType)flipType</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;                                           error:(NSError *__autoreleasing *)error;</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160; </div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;<span class="keyword">@end</span></div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160; </div>
</div><!-- fragment --></div><!-- contents -->
<div class="ttc" id="a_m_n_n_face_detector_8h_html_a57567af2cbd9dd6cc412f27cba05e8fc"><div class="ttname"><a href="_m_n_n_face_detector_8h.html#a57567af2cbd9dd6cc412f27cba05e8fc">MNNKitErrorDomain</a></div><div class="ttdeci">static NSString * MNNKitErrorDomain</div><div class="ttdef"><b>Definition:</b> MNNFaceDetector.h:13</div></div>
<div class="ttc" id="ainterface_m_n_n_face_detector_html"><div class="ttname"><a href="interface_m_n_n_face_detector.html">MNNFaceDetector</a></div><div class="ttdoc">Face Detector Class.</div><div class="ttdef"><b>Definition:</b> MNNFaceDetector.h:70</div></div>
<div class="ttc" id="ainterface_m_n_n_face_detector_create_config_html_af9b39fe67ad33dfe3dcc0dedebb3eab3"><div class="ttname"><a href="interface_m_n_n_face_detector_create_config.html#af9b39fe67ad33dfe3dcc0dedebb3eab3">MNNFaceDetectorCreateConfig::detectMode</a></div><div class="ttdeci">MNNFaceDetectMode detectMode</div><div class="ttdoc">detect mode, video or image</div><div class="ttdef"><b>Definition:</b> MNNFaceDetector.h:36</div></div>
<div class="ttc" id="a_m_n_n_face_detector_8h_html_a9835273e36af0cb70abe85ff24fe54f6"><div class="ttname"><a href="_m_n_n_face_detector_8h.html#a9835273e36af0cb70abe85ff24fe54f6">NS_ENUM</a></div><div class="ttdeci">typedef NS_ENUM(NSUInteger, MNNFaceDetectConfig)</div><div class="ttdoc">face detect config</div><div class="ttdef"><b>Definition:</b> MNNFaceDetector.h:17</div></div>
<div class="ttc" id="ainterface_m_n_n_face_detection_report_html"><div class="ttname"><a href="interface_m_n_n_face_detection_report.html">MNNFaceDetectionReport</a></div><div class="ttdoc">face detection result object</div><div class="ttdef"><b>Definition:</b> MNNFaceDetector.h:42</div></div>
<div class="ttc" id="ainterface_m_n_n_face_detector_create_config_html"><div class="ttname"><a href="interface_m_n_n_face_detector_create_config.html">MNNFaceDetectorCreateConfig</a></div><div class="ttdoc">face create config</div><div class="ttdef"><b>Definition:</b> MNNFaceDetector.h:33</div></div>
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
